package com.allwees.bs.module.oms.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.allwees.bs.core.model.order.entity.OrderItemModel;
import com.allwees.core.common.constant.EStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("oms_order_item")
public class OmsOrderItem extends OrderItemModel {

    /** 批次号 **/
    @Column(length = 12)
    private String batchNo;

    private String no;

    /** 结算单uuid **/
    @Column(length = 48, updatable = false)
    private String settleStatementUuid;

    /** 进入待结算日期 **/
    private Date joinSettleAt;

    /** 结算日期 **/
    private Date settledAt;

    /**
     * 物流公司名称(英文名)
     */
    protected String  logisticsNameEn;

    /**
     * 物流公司名称(中文名)
     */
    protected String  logisticsNameZh;
    /**
     * 订单结算状态
     */
    protected Integer settleState;

    /**
     * 商品自定义编号
     */
    protected String defNo;

    public  String  getSettleStateDesc(){
        return  settleState == null? "--": EStatus.byValue(settleState).desc();
    }
    public String getStatusDesc() {
        return status != null ? getEStatus().desc() : "";
    }
}
